<template>
	<view class="musicListBox" style="width: 92vw;">
		<view class="t-menu" style="flex-wrap:wrap">		
			<view class="t-menu-cell"  style="width: 25%" @tap="handleClickItem(item)"   v-for="(item,index) in musicList" :key="index">
				<image :src="item.image" class="t-menu-img" mode="aspectFill"></image>
				<view class='t-menu-name'>{{item.name}}</view>
			</view>
		</view>	
	</view>
</template>
<script>
	export default {
		//利用props接收数据
		props: {
			musicList: {
                type: Array,
                value: []
			}
		},
		data() {
			return {
			}
		},
		methods: {
			// 利用$emit发送事件
			handleClickItem(item) {
				this.$emit('childEvent', {
					flag: true,
					list: item,
				})
			}
		}
	}
</script>

<style scoped lang="less">
	/* component/t-menu/index.wxss */
	.t-menu {
	  display: flex;
	  flex-wrap: nowrap;
	  overflow-x: scroll;
	  overflow-y: auto;
	  padding: 30rpx 0 0 0;
	  background: #fff;
	  border-radius: 10rpx;
	}
	
	.t-menu-cell {
	  display: flex;
	  flex-direction: column;
	  align-items: center;
	  justify-content: center;
	  flex-shrink: 0;
	  margin-bottom: 30rpx;
	}
	
	.t-menu-img {
	  width: 88rpx;
	  height: 88rpx;
	  width: 88rpx;
	  // background: #F2F2F2;
	  // border-radius: 50%;
	}
	
	.t-menu-name {
	  margin-top: 10rpx;
	  font-size: 24rpx;
	}
</style>

